package com.company.ems.mapper;

import com.company.ems.model.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @Select("SELECT id, username, password, email, created_at AS createdAt " +
            "FROM users WHERE username = #{username} AND password = #{password}")
    User selectByUsernameAndPassword(
            @Param("username") String username,
            @Param("password") String password
    );

    @Select("SELECT id, username, password, email, created_at AS createdAt " +
            "FROM users WHERE id = #{id}")
    User selectById(Integer id);
}